package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.UserDao;
import com.itheima.pojo.SysUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@Service
@Slf4j
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

	@Override
	public boolean login(String username, String password) {
		System.out.println("service_provide...u:"+username+" p:"+password);
		if("admin".equals(username) && "123".equals(password)){
			return true;
		}
		return false;
	}

    @Override
    public SysUser findByUsername(String username) {
	    log.debug("UserServiceImpl: findByUsername: username ===> " + username);
	    SysUser sysUser = userDao.findByUsername(username);
	    log.debug("UserServiceImpl: findByUsername: sysUser ===> " + sysUser);
	    return sysUser;
    }
}